varying vec3 pos;
varying vec2 texCoord;
uniform sampler2D cloud;
uniform float time;

float module(vec3 a, vec3 b) {
    vec3 c = a - b;
    return sqrt(c.x*c.x + c.y*c.y + c.z*c.z);
}

void main(void) {
    vec4 color = texture2D(cloud,texCoord);
    float fren;
    if(time <= 16.0) fren = time/20.0;
    else fren = time/8.0;
    color.w /= fren*1.5/color.x;
    if(time >= 16.0) color.w = 0.0;
    //color.x = 0.0;
    //color.y = 2.0;
    color.z /= 4.0;
    gl_FragColor = color;
}
